SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_AlergicDelete]
	  @AlergicID int
	
AS
BEGIN
	SET NOCOUNT ON;
	DELETE FROM [Alergics]
	WHERE [AlergicID] = @AlergicID
END

/******    ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_AlergicGetAllByPatientID]
	  @PatientID int
	
AS
BEGIN
	SET NOCOUNT ON;
	SELECT *
	FROM [Alergics]
	WHERE 
		[PatientID] = @PatientID
END

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_AlergicInsert]
		  @AlergicID int
		, @Date datetime
		, @KindOfProbe nvarchar(50)
		, @Result1 nvarchar(50)
		, @Result2 nvarchar(50)
		, @Result3 nvarchar(50)
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	INSERT INTO [Alergics]
	(
		  [Date]
		, [KindOfProbe]
		, [Result1]
		, [Result2]
		, [Result3]
		, [patientID]
	) 
	VALUES 
	(
		  @Date
		, @KindOfProbe
		, @Result1
		, @Result2
		, @Result3
		, @patientID
	)		
END

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_AlergicUpdate]
		  @AlergicID int
		, @Date datetime
		, @KindOfProbe nvarchar(50)
		, @Result1 nvarchar(50)
		, @Result2 nvarchar(50)
		, @Result3 nvarchar(50)
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	UPDATE [Alergics]
	SET 
		  [Date] = @Date
		, [KindOfProbe] = @KindOfProbe
		, [Result1] = @Result1
		, [Result2] = @Result2
		, [Result3] = @Result2
		, [patientID] = @patientID
	WHERE 
		[AlergicID] = @AlergicID
END